package com.ternnetwork.batch.config.demo;



import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.excel.RowMapper;
import org.springframework.batch.item.excel.poi.PoiItemReader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ternnetwork.batch.mapper.demo.ExcelRowToCreditBillMapper;
import com.ternnetwork.batch.model.demo.CreditBill;


@Configuration
public class CreditBillExcelJob {
	
	@Bean
    ItemReader<CreditBill> excelCreditBillReader() {
        PoiItemReader<CreditBill> reader = new PoiItemReader<CreditBill>();
        reader.setRowMapper(excelRowMapper());
        return reader;
    }
 
    private RowMapper<CreditBill> excelRowMapper(){
       return new ExcelRowToCreditBillMapper();
    }

}
